//
//  FKGeneral.swift
//  FireKnowledge
//
//  Created by 杨伟毅 on 2019/4/19.
//  Copyright © 2019 wely. All rights reserved.
//

import Foundation
import UIKit
import SwiftyUserDefaults

struct FKScreenBound {
    static let Height = UIScreen.main.bounds.height
    static let Width = UIScreen.main.bounds.width
    // 状态栏高度
    static let StatusH = UIApplication.shared.statusBarFrame.size.height
    static let NavH = 44
    static let TopH = StatusH  + CGFloat(NavH)
    static let SafeH = Int(StatusH) > 20 ? 34 : 0
    static let BottomH =  49  + CGFloat(SafeH)
}

struct FKType {
    static let fkType = "一级消防工程师"
}
func FKRect (x:CGFloat, y:CGFloat, width:CGFloat, height:CGFloat) -> CGRect{
    return CGRect(x: x, y: y, width: width, height: height)
}
#if DEBUG
func jpushAps() ->Bool
{
    return false
}
#else
func jpushAps() ->Bool
{
    return true
}

#endif

func RGBA (r:CGFloat, g:CGFloat, b:CGFloat, a:CGFloat) -> UIColor{
    return UIColor (red: r/255.0, green: g/255.0, blue: b/255.0, alpha: a)
}

struct EquipmentInfo {
    // 获取设备的信息
    static  let infoDictionary = Bundle.main.infoDictionary!
    static let appDisplayName = infoDictionary["CFBundleDisplayName"] //程序名称
    static let majorVersion = infoDictionary["CFBundleShortVersionString"]//主程序版本号
    static let minorVersion = infoDictionary["CFBundleVersion"]//版本号（内部标示）
    static let appVersion = majorVersion as! String
    //设备信息
    static let iosVersion = UIDevice.current.systemVersion //iOS系统版本
    static let systemVersion = UIDevice.current.systemVersion //设备名称
    static let model = UIDevice.current.model //设备型号
    static let modelName = UIDevice.current.name //设备具体型号
    static let localizedModel = UIDevice.current.localizedModel //设备区域化型号如A1533
    static let bundleId = Bundle.main.infoDictionary?["CFBundleIdentifier"] as! String
}

struct CCSDKData {
    static let FKCCUserid = "5042EE22ABD606E1"
    static let FKCCApiKey = "SgqVSpzjRsVtlPJ1iWYsOe8hahXt98Yo"
    static  let  FKTestIphone = "13837167250"
}

extension DefaultsKeys {
    static let typeSecond = DefaultsKey<String?>("typeSecond") // 服务器返回类型
    static let typeSave = DefaultsKey<String?>("typeSave") // 保存的类型
    static let userIdSave = DefaultsKey<String?>("userIdSave") // userid
    static let  userPhone = DefaultsKey<String?>("userPhone") // 用户电话
    static let userNick = DefaultsKey<String?>("userNick") // 昵称
    static let userPic = DefaultsKey<String?>("userPic") // 用户的头像
    static let userGrade = DefaultsKey<String?>("userGrade") // 用户等级
    static let courseNetWorkStatus = DefaultsKey<String?>("courseNetWorkStatus") // 网络的保存值
    static let networkStatu = DefaultsKey<Bool>("networkStatus") // 网络存值的问题
}





